﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Cocbook_DTO;
using Cocbook_DAL;

namespace Cocbook_checker
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public static Project project;

        private void txtBookID_TextChanged(object sender, EventArgs e)
        {
            
            
            
        }

        public void Add() {

            txtAmount.Clear();
            txtBookName.Clear();
            txtBookID.Clear();
            txtBookID.Focus();
        }

        public void Search()
        {
            txtBookID.Focus();
        }

        public string getbookName(string ID) { return ""; }
        protected override bool ProcessDialogKey(Keys keyData)
        {
            switch (keyData)
            { 
                case Keys.Enter :
                    if (txtAmount.Text == "") {
                        txtBookName.Text = getbookName(txtBookID.Text);
                        txtAmount.Focus();
                    }
                    else{
                        Add();
                    }
                         break;

                case Keys.F1:
                         Search();
                        break;
                    }
            return base.ProcessDialogKey(keyData);}

        private void btnClear_Click(object sender, EventArgs e)
        {
            
                               
        }
        


        private void btnAddBook_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
